<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script src="https://unpkg.com/react@18/umd/react.development.js"></script>
  <script src="https://unpkg.com/react-dom@18/umd/react-dom.development.js"></script>

  <!-- Don't use this in production: -->
  <script src="https://unpkg.com/@babel/standalone/babel.min.js"></script>
</head>

<body>
  <div id="root"></div>
  <div id="app"></div>
  <script type="text/babel">


    class APP extends React.Component {
      // 组件数据
      constructor() {
        super()
        this.state = {
          movies: ['哪吒', '大话西游', '大圣取经', '星际穿越']
        }
      }
  
      //渲染内容 render方法
      render() {
        return (
          <div>
            <h2>
              电影列表
            </h2>
            {this.state.movies.map(movie => <li>{movie}</li>)}
          </div>
        )
      }
    }

    const root = ReactDOM.createRoot(document.getElementById('root'))
    root.render(<APP />)



  </script>
</body>

</html>